package com.bingbing.back.controller;

import com.bingbing.back.dto.SchoolMajorDto;
import com.bingbing.back.po.SchoolMajor;
import com.bingbing.back.service.SchoolMajorService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/schoolMajor")
public class SchoolMajorController {
    @Resource
    private SchoolMajorService schoolMajorService;

    // 根据学校id显示国家特色专业
    @RequestMapping("/showSchoolNationMajor")
    public List<SchoolMajor> showSchoolNationMajor(int schoolId){
        return schoolMajorService.showSchoolNationMajor(schoolId);
    }

    // 根据学校id显示所有专业并且按类别分类
    @RequestMapping("/showSchoolAllMajor")
    public List<SchoolMajorDto> showSchoolAllMajor(int schoolId){
        return schoolMajorService.showSchoolAllMajor(schoolId);
    }
}
